package com.we823.cms.repository.service.extension;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.we823.cms.model.extension.ProductPhoto;
import com.we823.cms.repository.dao.extension.ProductPhotoMapper;
import com.we823.cms.repository.service.AbstractBaseService;

@Service("productPhotoService")
@Scope("prototype")
public class ProductPhotoService extends AbstractBaseService<ProductPhoto, Integer> {

	private ProductPhotoMapper productPhotoMapper;
	
	@Autowired
	public ProductPhotoService(ProductPhotoMapper productPhotoMapper) {
		super(productPhotoMapper);
		this.productPhotoMapper = productPhotoMapper;
	}

	public List<ProductPhoto> findByProductid(Integer id) {
		ProductPhoto productPhoto = new ProductPhoto();
		productPhoto.setProductId(id);
		return productPhotoMapper.select(productPhoto);
	}

}
